package com.haiya.scg.learning.config;

import com.haiya.scg.learning.filter.OneGlobalFilter;
import com.haiya.scg.learning.filter.ThreeGlobalFilter;
import com.haiya.scg.learning.filter.TwoGlobalFilter;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

/**
 *
 * @author qiaoguoqiang
 */
@Configuration
public class FilterConfig {

    @Bean
    @Order(-1)
    public GlobalFilter oneFilter() {
        return new OneGlobalFilter();
    }

    @Bean
    @Order(0)
    public GlobalFilter twoFilter() {
        return new TwoGlobalFilter();
    }

    @Bean
    @Order(1)
    public GlobalFilter threeFilter() {
        return new ThreeGlobalFilter();
    }
}
